package main

import (
	"io"
	"log"
	"os"
	"strings"
)

func main() {
	{
		r := strings.NewReader("some io. Reader stream to be read\n")
		if _, err := io.Copy(os.Stdout, r); err != nil {
			log.Fatal(err)
		}
	}

	//和io.Copy一样，只不过手动提供了buf
	//io.CopyBuffer()

	//只copy前n个
	//io.CopyN()
	{
		r := strings.NewReader("some io. Reader stream to be read\n")
		if _, err := io.CopyN(os.Stdout, r, 10); err != nil {
			log.Fatal(err)
		}
	}

	{
		//os.Mkdir()
		//os.MkdirAll()
		//os.MkdirTemp()
		//os.Remove()
		//os.RemoveAll()
		//os.Rename()
		//path.Base()
		//filepath.Abs()
	}
}
